import { ZAN_JIA, ZAN_JIAN } from "../constants";
//声明函数
const ZanReducer = (state=0, action) => {
    //判断
    switch(action.type){
        case ZAN_JIA:
            return state + action.data;
        case ZAN_JIAN:
            return state - action.data;
        default: 
            return state;
    }
}

export default ZanReducer;